ALTER PROCEDURE [dbo].[USP_IVR_IMPORT_SaveTranItem]
(@TRNID INT,
@ITMID INT,
@ADDNDESC VARCHAR(150),
@RATE numeric(17, 3)=Null,
@ITMQTY numeric(11, 4)=Null,
@FREIGHT varchar(50),
@ITMAMT numeric(17, 3)=Null,
@COO VARCHAR(50),
@EXTENDEDVALUE VARCHAR(50),
@UNITPRICEINR VARCHAR(50),
@INVOICEVALUE VARCHAR(50),
@ACCESSVALUE VARCHAR(50),
@BASICCUSTOMDUTY VARCHAR(50),
@CVD VARCHAR(50),
@EDUCESSONCVD VARCHAR(50),
@HEDUCESSONCVD VARCHAR(50),
@TOTALDUTY VARCHAR(50),
@CUSTOMEDUCATIONAL VARCHAR(50),
@CUSTOMHEDU VARCHAR(50),
@ADDDUTY VARCHAR(50),
@GRANDTOTALDUTY VARCHAR(50),
@UOMID INT = NULL,
@RATEINCL NUMERIC(17, 3) = NULL,
@ALTITMQTY NUMERIC(11, 4) = NULL,
@GROSSAMT NUMERIC(17, 3) = NULL,
@DISCPER NUMERIC(6, 3) = NULL, 
@DISCAMT NUMERIC(17, 3) = NULL,
@CENVATPER NUMERIC(6, 3) = NULL,  
@CENVATAMT NUMERIC(17, 3) = NULL,   
@PRIMARYCESSPER NUMERIC(6, 3) = NULL, 
@PRIMARYCESSAMT NUMERIC(17, 3) = NULL,
@HIGHERCESSPER NUMERIC(6, 3) = NULL, 
@HIGHERCESSAMT NUMERIC(17, 3) = NULL, 
@ITMPENDINGQTY NUMERIC(11, 4) = NULL,   
@ITMAMT_LID INT = NULL,  
@TAXAMT_LID INT = NULL,
@EntryType varchar(50),
@IssueQty int,
@ReturnQty int,
@ReturnDate Datetime=NULL
)
AS
BEGIN
INSERT INTO IVR_TRAN_ITEM 
(
TRNID,ITMID,ADDNDESC,RATE,ITMQTY,FREIGHT,ITMAMT,
COO,EXTENDEDVALUE,UNITPRICEINR,INVOICEVALUE,ACCESSVALUE,BASICCUSTOMDUTY,
CVD,EDUCESSONCVD,HEDUCESSONCVD,TOTALDUTY,CUSTOMEDUCATIONAL,CUSTOMHEDU,
ADDDUTY,GRANDTOTALDUTY,UOMID,RATEINCL, ALTITMQTY,GROSSAMT,DISCPER,DISCAMT,CENVATPER,CENVATAMT,
PRIMARYCESSPER,PRIMARYCESSAMT,HIGHERCESSPER,HIGHERCESSAMT,ITMPENDINGQTY,ITMAMT_LID,TAXAMT_LID,EntryType,IssueQty,
ReturnQty,ReturnDate
)
VALUES
(
@TRNID,@ITMID,@ADDNDESC,@RATE,@ITMQTY,@FREIGHT,@ITMAMT,
@COO,@EXTENDEDVALUE,@UNITPRICEINR,@INVOICEVALUE,@ACCESSVALUE,@BASICCUSTOMDUTY,@CVD,
@EDUCESSONCVD,@HEDUCESSONCVD,@TOTALDUTY,@CUSTOMEDUCATIONAL,@CUSTOMHEDU,
@ADDDUTY,@GRANDTOTALDUTY,@UOMID,@RATEINCL,   @ALTITMQTY,@GROSSAMT,@DISCPER,@DISCAMT,@CENVATAMT,@CENVATPER,@PRIMARYCESSPER,
@PRIMARYCESSAMT,@HIGHERCESSPER,@HIGHERCESSAMT,@ITMPENDINGQTY,@ITMAMT_LID,@TAXAMT_LID,@EntryType,@IssueQty,@ReturnQty,
@ReturnDate
)
END










ALTER PROCEDURE [dbo].[USP_IVR_SaveTranItem]      
(       
@TRNID INT,        
@ITMID INT,     
@ADDNDESC VARCHAR(150) = NULL,        
@WHSID INT = NULL,    
@ITMQTY NUMERIC(11, 4) = NULL,        
@ALTITMQTY NUMERIC(11, 4) = NULL,    
@UOMID INT = NULL,        
@RATEINCL NUMERIC(17, 3) = NULL,     
@RATE NUMERIC(17, 3) = NULL,        
@GROSSAMT NUMERIC(17, 3) = NULL,      
@DISCPER NUMERIC(6, 3) = NULL,        
@DISCAMT NUMERIC(17, 3) = NULL,     
@CENVATPER NUMERIC(6, 3) = NULL,        
@CENVATAMT NUMERIC(17, 3) = NULL,    
@PRIMARYCESSPER NUMERIC(6, 3) = NULL,       
@PRIMARYCESSAMT NUMERIC(17, 3) = NULL,       
@HIGHERCESSPER NUMERIC(6, 3) = NULL,       
@HIGHERCESSAMT NUMERIC(17, 3) = NULL,       
@NETAMT NUMERIC(17, 3) = NULL,        
@TAX_TXMASID SMALLINT = NULL,    
@TAXPER NUMERIC(6, 3) = NULL,        
@TAXAMT NUMERIC(17, 3) = NULL,   
@ITMAMT NUMERIC(17, 3) = NULL,        
@DC_TITID INT = NULL,        
@ITMPENDINGQTY NUMERIC(11, 4) = NULL,        
@ITMAMT_LID INT = NULL,     
@TAXAMT_LID INT = NULL ,
@FREIGHT varchar(50),
@PACKAGING varchar(50),
@INSURANCE varchar(50),
@EntryType varchar(50),
@ReturnQty int=NULL,
@ReturnDate Date=NULL,
@IssueQTY int,
@ServiceTax decimal(18,5),
@ServiceTaxAmount decimal(18,5)
)  
AS    
BEGIN         
INSERT  INTO IVR_TRAN_ITEM                          
(                            
TRNID,ITMID,ADDNDESC,ITMQTY,ALTITMQTY,UOMID,                            
RATEINCL,RATE,GROSSAMT,DISCPER,DISCAMT,CENVATPER,                            
CENVATAMT,PRIMARYCESSPER,PRIMARYCESSAMT,HIGHERCESSPER,
HIGHERCESSAMT,NETAMT,TAX_TXMASID,TAXPER,TAXAMT,ITMAMT,
DC_TITID,ITMPENDINGQTY,ITMAMT_LID,TAXAMT_LID,FREIGHT,
PACKAGING,INSURANCE,EntryType,ReturnQty,ReturnDate,IssueQty,
SERVICETAX,SERVICETAXAMOUNT
)                  
VALUES  
(                            
@TRNID,@ITMID,@ADDNDESC,@ITMQTY,@ALTITMQTY,@UOMID,@RATEINCL,@RATE,
@GROSSAMT,@DISCPER,@DISCAMT,@CENVATPER,@CENVATAMT,@PRIMARYCESSPER,
@PRIMARYCESSAMT,@HIGHERCESSPER,@HIGHERCESSAMT,@NETAMT,@TAX_TXMASID,                            
@TAXPER,@TAXAMT,@ITMAMT,@DC_TITID,@ITMPENDINGQTY,@ITMAMT_LID,@TAXAMT_LID,@FREIGHT,
@PACKAGING,@INSURANCE,@EntryType,@ReturnQty,@ReturnDate,@IssueQTY,
@ServiceTax,@ServiceTaxAmount
)                       
END         